package org.jeecg.modules.monitoring.j_monitoring.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description: 存储设备(管理)
 * @Author: xiaoyq
 * @Date:   2023-02-22
 * @Version: V1.0
 */
@Data
@TableName("m_gl_storage_resources")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="存储设备(管理)", description="存储设备(管理)")
public class MGlStorageResources implements Serializable {
    private static final long serialVersionUID = 1L;

	/**id;主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "id;主键")
    private String id;
	/**设备名称*/
	@Excel(name = "设备名称", width = 15)
    @ApiModelProperty(value = "设备名称")
    private String name;
	/**设备型号*/
	@Excel(name = "设备型号", width = 15)
    @ApiModelProperty(value = "设备型号")
    private String model;
	/**设备序列号*/
	@Excel(name = "设备序列号", width = 15)
    @ApiModelProperty(value = "设备序列号")
    private String equipmentSerialNumber;
	/**设备类型*/
	@Excel(name = "设备类型", width = 15, dicCode = "j_sblx")
	@Dict(dicCode = "j_sblx")
    @ApiModelProperty(value = "设备类型")
    private String equipmentClassification;
	/**管理IP*/
	@Excel(name = "管理IP", width = 15)
    @ApiModelProperty(value = "管理IP")
    private String deviceIp;
	/**使用状态*/
	@Excel(name = "使用状态", width = 15, dicCode = "j_syzt")
	@Dict(dicCode = "j_syzt")
    @ApiModelProperty(value = "使用状态")
    private String usageStatus;
	/**设备用途*/
	@Excel(name = "设备用途", width = 15, dicCode = "j_sbyt")
	@Dict(dicCode = "j_sbyt")
    @ApiModelProperty(value = "设备用途")
    private String purpose;
	/**控制器数量*/
	@Excel(name = "控制器数量", width = 15)
    @ApiModelProperty(value = "控制器数量")
    private Integer controllersNo;
	/**存储笼数量*/
	@Excel(name = "存储笼数量", width = 15)
    @ApiModelProperty(value = "存储笼数量")
    private Integer storageCagesNo;
	/**硬盘数量*/
	@Excel(name = "硬盘数量", width = 15)
    @ApiModelProperty(value = "硬盘数量")
    private Integer hardDisksNo;
	/**硬盘总容量(G)*/
	@Excel(name = "存储裸容量(T)", width = 15)
    @ApiModelProperty(value = "存储裸容量(TB)")
    private BigDecimal singleHardDiskNo;
	/**硬盘总容量(G)*/
	@Excel(name = "硬盘总容量(T)", width = 15)
	@ApiModelProperty(value = "硬盘总容量(TB)")
	private BigDecimal singleHardDiskCount;
	/**硬盘总容量(G)*/
//	@Excel(name = "硬盘总容量(T)", width = 15)
	@ApiModelProperty(value = "已用容量(TB)")
	private BigDecimal usedCapacity;
	/**硬盘列表*/
//	@Excel(name = "硬盘列表", width = 15)
    @ApiModelProperty(value = "硬盘列表")
    private String hardList;
	/**硬盘列表*/
//	@Excel(name = "盘柜列表", width = 15)
	@ApiModelProperty(value = "盘柜列表")
	private String cabinetList;
	/**硬盘列表*/
//	@Excel(name = "控制器列表", width = 15)
	@ApiModelProperty(value = "控制器列表")
	private String regulatorList;
	/**电源规格*/
	@Excel(name = "电源规格", width = 15)
    @ApiModelProperty(value = "电源规格")
    private String powerSpecification;
	/**电源数量*/
	@Excel(name = "电源数量", width = 15)
    @ApiModelProperty(value = "电源数量")
    private Integer powerNo;
	/**额定功率(w)*/
	@Excel(name = "额定功率(w)", width = 15)
    @ApiModelProperty(value = "额定功率(w)")
    private String devicePower;
	/**品牌(制造)商*/
	@Excel(name = "品牌(制造)商", width = 15)
    @ApiModelProperty(value = "品牌(制造)商")
    private String deviceProducer;
	/**供应商*/
	@Excel(name = "供应商", width = 15)
    @ApiModelProperty(value = "供应商")
    private String deviceSupplier;
	/**维保商*/
	@Excel(name = "维保商", width = 15)
    @ApiModelProperty(value = "维保商")
    private String deviceExpiry;
	/**资产编号*/
	@Excel(name = "资产编号", width = 15)
    @ApiModelProperty(value = "资产编号")
    private String assetNo;
	/**合同编号*/
	@Excel(name = "合同编号", width = 15)
    @ApiModelProperty(value = "合同编号")
    private String contractNo;
	/**设备编号*/
	@Excel(name = "设备编号", width = 15)
    @ApiModelProperty(value = "设备编号")
    private String equipmentNo;
	/**责任人*/
	@Excel(name = "责任人", width = 15, dictTable = "sys_user", dicText = "realname", dicCode = "username")
	@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
    @ApiModelProperty(value = "责任人")
    private String personLiable;
	/**投产时间*/
	@Excel(name = "投产时间", width = 15)
    @ApiModelProperty(value = "投产时间")
    private String productionDate;
	/**配置类型*/
	@Excel(name = "配置类型", width = 15, dicCode = "j_cc_pzlx")
	@Dict(dicCode = "j_cc_pzlx")
    @ApiModelProperty(value = "配置类型")
    private String configurationType;
	/**产品序列号*/
	@Excel(name = "产品序列号", width = 15)
    @ApiModelProperty(value = "产品序列号")
    private String productId;
	/**维保开始时间*/
	@Excel(name = "维保开始时间", width = 15)
    @ApiModelProperty(value = "维保开始时间")
    private String installDate;
	/**维保结束时间*/
	@Excel(name = "维保结束时间", width = 15)
    @ApiModelProperty(value = "维保结束时间")
    private String expiryDateOfMaintenance;
	/**报废年限*/
	@Excel(name = "报废年限", width = 15)
    @ApiModelProperty(value = "报废年限")
    private String scrapLife;
	/**是否监测*/
	@Excel(name = "是否监测", width = 15, dicCode = "j_sfjc")
	@Dict(dicCode = "j_sfjc")
    @ApiModelProperty(value = "是否监测")
    private String whetherToMonitor;
	/**上联网络交换机*/
	@Excel(name = "上联网络交换机", width = 15)
    @ApiModelProperty(value = "上联网络交换机")
    private String onlineNetworkSwitch;

	@ApiModelProperty(value = "网络交换机Name")
	@Dict(dictTable = "m_gl_network_resource",dicCode = "id",dicText = "concat_ws('',name,' 型号:',model,' IP:',manage_ip,' 机柜:',cabinet,' U位:',use_u_q,'~',use_u_h)")
	private java.lang.String onlineNetworkSwitchId;

	/**上联光纤交换机*/
	@Excel(name = "上联光纤交换机", width = 15)
    @ApiModelProperty(value = "上联光纤交换机")
    private String uplinkOpticalSwitch;

	@ApiModelProperty(value = "光纤交换机Name")
	@Dict(dictTable = "m_gl_network_resource",dicCode = "id",dicText = "concat_ws('',name,' 型号:',model,' IP:',manage_ip,' 机柜:',cabinet,' U位:',use_u_q,'~',use_u_h)")
	private java.lang.String uplinkOpticalSwitchId;

	/**关联应用*/
	@Excel(name = "关联应用", width = 15)
    @ApiModelProperty(value = "关联应用")
    private String associatedApplication;
	/**所属区域*/
	@Excel(name = "所属区域", width = 15)
    @ApiModelProperty(value = "所属区域")
    private String region;
	/**所属机房*/
	@Excel(name = "所属机房", width = 15)
    @ApiModelProperty(value = "所属机房")
    private String machineRoom;
	/**所属机柜*/
	@Excel(name = "所属机柜", width = 15)
    @ApiModelProperty(value = "所属机柜")
    private String cabinet;
	/**高度(U)*/
	@Excel(name = "高度(U)", width = 15)
    @ApiModelProperty(value = "高度(U)")
    private BigDecimal height;
	/**使用U位前*/
	@Excel(name = "使用U位前", width = 15)
    @ApiModelProperty(value = "使用U位前")
    private String useUQ;
	/**使用U位后*/
	@Excel(name = "使用U位后", width = 15)
    @ApiModelProperty(value = "使用U位后")
    private String useUH;

	/**区域id*/
	@ApiModelProperty(value = "区域id")
	private java.lang.String regionId;
	/**机房Id*/
	@ApiModelProperty(value = "机房Id")
	private java.lang.String machineRoomId;
	/**机柜id*/
	@ApiModelProperty(value = "机柜id")
	private java.lang.String cabinetId;


	private String monitorStatus;

	@ApiModelProperty(value = "品牌(制造)商")
	private java.lang.String deviceProducerId;
	@ApiModelProperty(value = "供应商")
	private java.lang.String deviceSupplierId;
	@ApiModelProperty(value = "	 维保商Id")
	private java.lang.String deviceExpiryId;
	@ApiModelProperty(value = "责任人id")
	private java.lang.String personLiableId;

	/**备注*/
	@Excel(name = "备注", width = 15)
	@ApiModelProperty(value = "备注")
	private java.lang.String remarks;

	@ApiModelProperty(value = "显示名称")
	private String displayName;

	public String autoSetDisplayName(){
		this.displayName = this.getName() + " 型号:" + this.getModel() + ( this.deviceIp!=null? " IP:" + this.getDeviceIp() +"" : "" )+ " 机柜:" + this.getCabinet()
				+ (this.useUH!=null || this.useUQ!=null ? " U位:"+ this.useUQ + "~"+this.useUH:"");
		return this.displayName;
	}


	/**创建时间*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@ApiModelProperty(value = "创建时间")
	private java.util.Date createTime;

	/**更新时间*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@ApiModelProperty(value = "更新时间")
	private java.util.Date updateTime;

	/**创建人*/
	@ApiModelProperty(value = "创建人")
	private java.lang.String createBy;

	/**更新人*/
	@ApiModelProperty(value = "更新人")
	private java.lang.String updateBy;

	@TableField(exist = false)
	private Boolean isMonitor = false;

	private String runTime;
	private String pingTime;
	private String cpuUse;
	private String iops;
	private Integer redController;
	private Integer greenController;
	private Integer greenDisk;
	private Integer redDisk;
	private Integer greenPower;
	private Integer redPower;
	private Integer greenFan;
	private Integer redFan;
	private String tableJson;

	@TableField(exist = false)
	private BigDecimal residue;
	@TableField(exist = false)
	private int month;
}
